home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / More Source / Pascal / Skel 3.0i / Skel report.p < prev    next >
Text File  |  1994-04-12  |  1KB  |  32 lines

  1. unit Report;
  2.  
  3. interface
  4.     uses
  5.         Globals;
  6.  
  7.     procedure Report (reportstr: StringHandle);
  8.  
  9. implementation
  10.  
  11. {Print a string in dialog box}
  12. {############################   Report   #################################}
  13.  
  14. {We put up a dialog box, show the string, and wait for user to hit OK.}
  15.  
  16.     procedure Report (reportstr: StringHandle);
  17. {char   ^^reportstr;}
  18.         const
  19.             rptboxid = 257;        (* ID of our report dialog in resource file *)
  20.             rpttext = 2;            (* Item # of dialog's report text *)
  21.         var
  22.             itemhit: integer;        (* which Item was clicked on (only OK avail) *)
  23.             reportptr: DialogPtr;
  24.     begin
  25.         ParamText(reportstr^^, '', '', '');(* set text to display *)
  26.         reportptr := GetNewDialog(rptboxid, nil, WindowPtr(-1));
  27.                 (* get from Resource file; NIL => use heap storage; -1 => make dlg frontmost *)
  28.         ModalDialog(nil, itemhit);
  29.                 (* carry out dialog; NIL => no FilterProc; return Item Hit when done *)
  30.         DisposDialog(reportptr);    (* release storage and remove dialog from screen *)
  31.     end;                (* Report *)
  32. end.